package com.kcwoo.shaokun.rxjavalearning.arc

import android.arch.lifecycle.Observer
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.kcwoo.shaokun.rxjavalearning.R
import kotlinx.android.synthetic.main.f_layout.*


/**
 * Created by kevin on 2017/11/8.
 *  step one small every day
 */
class UserFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.f_layout, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        val user = UserLiveData()
        user.observe(this, Observer { it ->
            textView.text = "这里不用管数据的变化:"+it?.name + it?.age
        })
    }
}